<?php
/**
 *      [迷你云] (C)2009-2012 南京恒为网络科技.
 *   软件仅供研究与学习使用，如需商用，请访问www.miniyun.cn获得授权
 * 
 */
?>
<?php


class MOptions extends MModel
{


    
    public function queryMeta($key) {
        $db = MDbManager::getInstance();
        $sql = "select * from ".DB_PREFIX."_options where option_name=\"{$key}\"";

        FXP::trace("queryMeta:".$sql);
        $db_data =  $db->selectDb($sql);

        if (empty($db_data)){
            return false;
        }
        
        return $this->assembleData($db_data[0]);
    }
    

    
    private function assembleData($db_data){
        $this->id             = $db_data["option_id"];
        $this->option_name    = $db_data["option_name"];
        $this->option_value   = $db_data["option_value"];
        return $this;
    }
}
?>